package com.aytbayev.asyl;

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;

public class Instrument {
	private int id;
	private int idKase;
	private String ShortName;
	private byte typeGlass;
	private String status;
	private boolean IsBlocked;
	private float ask;
	private float AskH;
	private float bid;
	private float BidH;
	private float last;
	private float lastH;
	private float pctChg1d;
	private boolean doBlink;
	
	public int getId() {
		return id;
	}
	
	public int getIdKase(){
		return idKase;
	}
	
	public String getShortName() {
		return ShortName;
	}

	public byte getTypeGlass(){
		return typeGlass;
	}
	
	public String getStatus() {
		return status;
	}
		
	public boolean isBlocked() {
		return IsBlocked;
	}
	
	public float getAsk() {
		return ask;
	}

	public float getAskH() {
		return AskH;
	}

	public float getBid() {
		return bid;
	}

	public float getBidH() {
		return BidH;
	}
	
	public float getLast() {
		return last;
	}

	public float getLastH() {
		return lastH;
	}		
	
	public float getPctChg1d() {
		return pctChg1d;
	}
		
	public String format( float a) {
		if( a != 0){
			DecimalFormatSymbols formatSymbols =  new DecimalFormatSymbols();
		    formatSymbols.setGroupingSeparator(' ');
	
		    DecimalFormat myFormatter = new DecimalFormat("###,###.##", formatSymbols);
		    return myFormatter.format(a);
		} else {
			return "-";
		}
	}
	
	//TODO remove test methods
	public void doBlink() {
		doBlink = true;
	}
	
	public boolean getBlink() {
		return this.doBlink;
	}
}
